package ch03.jdkProxy;

import java.lang.reflect.Method;

/**
 * @author Jane
 * @date 2024-03-25 16:32
 */

public class Test {
    public static void main(String[] args) {
//        BuyInvocationHandler invocation = new BuyInvocationHandler();
//        HouseBuyer houseBuyer = new HouseBuyer();
//        invocation.setBuyer(houseBuyer);

        Buy buy = JdkProxyFactory.getInstance(new HouseBuyer());
        String msg = buy.pay();
        //System.out.println(msg);
        System.out.println("---------------------");

        Buy buy1 = JdkProxyFactory.getInstance(new CarBuyer());
        String msg1 = buy1.pay();

    }
}
